package com.ruoyi.backend.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.backend.mapper.MessageNoticeMapper;
import com.ruoyi.backend.domain.MessageNotice;
import com.ruoyi.backend.service.IMessageNoticeService;

/**
 * 消息通知Service业务层处理
 * 
 * @author wjr
 * @date 2025-09-23
 */
@Service
public class MessageNoticeServiceImpl implements IMessageNoticeService 
{
    @Autowired
    private MessageNoticeMapper messageNoticeMapper;

    /**
     * 查询消息通知
     * 
     * @param id 消息通知主键
     * @return 消息通知
     */
    @Override
    public MessageNotice selectMessageNoticeById(Integer id)
    {
        return messageNoticeMapper.selectMessageNoticeById(id);
    }

    /**
     * 查询消息通知列表
     * 
     * @param messageNotice 消息通知
     * @return 消息通知
     */
    @Override
    public List<MessageNotice> selectMessageNoticeList(MessageNotice messageNotice)
    {
        return messageNoticeMapper.selectMessageNoticeList(messageNotice);
    }

    /**
     * 新增消息通知
     * 
     * @param messageNotice 消息通知
     * @return 结果
     */
    @Override
    public int insertMessageNotice(MessageNotice messageNotice)
    {
        messageNotice.setCreateTime(DateUtils.getNowDate());
        return messageNoticeMapper.insertMessageNotice(messageNotice);
    }

    /**
     * 修改消息通知
     * 
     * @param messageNotice 消息通知
     * @return 结果
     */
    @Override
    public int updateMessageNotice(MessageNotice messageNotice)
    {
        return messageNoticeMapper.updateMessageNotice(messageNotice);
    }

    /**
     * 批量删除消息通知
     * 
     * @param ids 需要删除的消息通知主键
     * @return 结果
     */
    @Override
    public int deleteMessageNoticeByIds(Integer[] ids)
    {
        return messageNoticeMapper.deleteMessageNoticeByIds(ids);
    }

    /**
     * 删除消息通知信息
     * 
     * @param id 消息通知主键
     * @return 结果
     */
    @Override
    public int deleteMessageNoticeById(Integer id)
    {
        return messageNoticeMapper.deleteMessageNoticeById(id);
    }
}
